<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.otupia.wui.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
		@import "js/dojo/resources/dojo.css";
		@import "js/dijit/tests/css/dijitTests.css";
	</style>


<link id="themeStyles" rel="stylesheet" href="js/dijit/themes/claro/claro.css">
<script type="text/javascript" src="js/dojo/dojo.js"></script>
<script type='text/javascript' src='/wui/dwr/interface/userService.js'></script>
<script type='text/javascript' src='/wui/dwr/engine.js'></script>



<script type="text/javascript">
	dojo.require("dojo.fx");
	dojo.require("dijit.Editor");
	dojo.require("com.otupia.userInfo");
	dojo.require("dijit.layout.TabContainer");
    dojo.require("dijit.layout.ContentPane");

	function test() {
		alert("aaaa");
	}
	dojo.require("com.otupia.messageSender");
	dojo.require("com.otupia.moduleManager");

	var testModuleList = [ {
		who : "com.otupia.module.application.login",
		command : {
			method : "show",
			arguments : {
				container : "loginBox"
			}
		},
		callerInfo : {
			caller : "com.otupia.module.frame.test",
			taskKey : "loginBox"
		}

	},
	{
		who : "com.otupia.module.application.messageBox",
		command : {
			method : "show",
			arguments : {
				container : "rightMessageBox"
			}
		},
		callerInfo : {
			caller : "com.otupia.module.frame.test",
			taskKey : "rightMessageBox"
		}
	},
	{
		who : "com.otupia.module.application.blog",
		command : {
			method : "show",
			arguments : {
				container : "midArea"
			}
		},
		callerInfo : {
			caller : "com.otupia.module.frame.test",
			taskKey : "midArea"
		}
	}
	];
	function showMainModule() {
		var test = com.otupia.moduleManager;
		test.call("com.otupia.module.frame.test", {
			method : "show",
			arguments : {
				container : "main",
				moduleList : testModuleList
			}
		}, {
			caller : null,
			taskKey : "test"
		});
	}
	dojo.addOnLoad(showMainModule);
	//com.otupia.userInfo.init({userID:"001",userName:"caojianpu"});
	//com.otupia.messageSender.init();

	//var sender = com.otupia.messageSender;
	//dojo.subscribe("testModule",testHandler);
	/*
	function testSend()
	{
		var message = {
			param : [
				"a","b","c"
			],
			module:"testModule",
			};
		com.otupia.messageSender.send(message,"001");
	}
	 */
	function testHandler(a, b, c) {
		console.log("******************|||||          " + a + b + c);
	}

	function sendLocalMessage()
	{
		
		var title = dojo.byId("title").value;
		var content = dojo.byId("content").value;

		var message = 
		{
			title : title,
			content : content
		};

		dojo.publish("com.otupia.module.application.messageBox",[message]);
	}

</script>

<title>My JSP 'MyJsp.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

</head>

<body  class="claro">
<%=PageUtil.getDefaultPage(request)%>

<div id="main"></div>
<div style="position:absolute;top:400px">
	<input type="text" id="title"></input>"
	<input type="text" id="content"></input>"
	<input type="button" onclick="sendLocalMessage();" value="send local message"></input>
</div>
</body>
</html>
